package com.dinim.math;


public class TrigonometryUtil {

//	public static void main(String[] args) {
//		System.out.println(getAngleWithAdjacentLeg(5, GeometryUtil.getLength(0, 0, 5, 5)));
//		System.out.println(getAngleWithAdjacentLeg(-5, GeometryUtil.getLength(0, 0, -5, -5)));
//		
//		//System.out.println(GeometryUtil.getLength(1, 1, 5, 5));
//	}
	
	public static final double getAngleWithAdjacentLeg(double adjacentLeg, double hypotenuse){
        double angle = Math.toDegrees(Math.acos(adjacentLeg / hypotenuse));
		if(angle < 0){
		    throw new RuntimeException();
        }
        return angle;
	}
	
	public static final double getAngleWithOppositeLeg(double oppositeLeg, double hypotenuse){
		return Math.toDegrees(Math.asin(oppositeLeg / hypotenuse));
	}
	
	public static final double getAngleWithoutHypotenuse(double adjacentLeg, double oppositeLeg){
		return Math.toDegrees(Math.atan(oppositeLeg / adjacentLeg));
	}

//	public class Triangle{
//		
//		private double alpha, beta, gamma;
//		private double a, b, c;
//		private Point A, B, C;
//		private double heightAa, heightBb, heightCc;
//		
//	}
	
}
